import React,{useState} from 'react'
import { Button, Space, Table } from 'antd';

export default function Index() {

    const columns = [
        {
          title: '部门名称',
          dataIndex: 'name',
          width: 80,
          render: (text) => <a href='/home/add_income'>{text}</a>,
        },
        {
          title: '联系人',
          dataIndex: 'lxr',
          width: 100,
        },
        {
          title: '手机号码',
          dataIndex: 'sjhm',
          width: 120,
        },
        {
          title: 'QQ',
          dataIndex: 'qq',
          width: 120,
        },
        {
          title: '客户类型',
          dataIndex: 'khlx',
          width: 100,
        },
        {
          title: '客户来源',
          dataIndex: 'khly',
          width: 150,
        },
        {
          title: '备注',
          dataIndex: 'bz',
          width: 120,
        },
        {
          title: '录入时间',
          dataIndex: 'lrsj',
          width: 150,
        },
        {
          title: '业务员',
          dataIndex: 'ywy',
          width: 100,
        },
        {
          title: '管理',
          render: (_, record) => (
            <Space size="middle">
              <Button size="small">修改</Button>
              <Button size="small">删除</Button>
              <Button size="small">未审核</Button>
            </Space>
          ),
        },
      ];

      //设置数据
  const [items, setItems] = useState([{
    id: 1,
    name: '哈哈',
    lxr: '小陈',
    sjhm: 1,
    qq: '产品续费',
    khlx: 500,
    khly: '250',
    bz: '2022-08-10',
    lrsj: '2022-08-10  19:17',
    ywy: '1'
  },
  {
    id: 2,
    name: '小罗',
    lxr: '小陈',
    sjhm: 1,
    qq: '产品续费',
    khlx: 500,
    khly: '250',
    bz: '2022-08-10',
    lrsj: '2022-08-10  19:17',
    ywy: '1'
  },
  {
    id: 2,
    name: '小二',
    lxr: '小陈',
    sjhm: 1,
    qq: '产品续费',
    khlx: 500,
    khly: '250',
    bz: '2022-08-10',
    lrsj: '2022-08-10  19:17',
    ywy: '1'
  },
 ])

  return (
    <div>
        <Table columns={columns} rowKey={record => record.id} dataSource={items} pagination={{ defaultPageSize: 1 }} />
    </div>
  )
}
